﻿using System.Net;
using Elsa.Activities.Http;
using Elsa.Builders;

namespace ElsaApp
{
    /// <summary>
    /// 这是通过代码装了一个工作流的环节
    /// </summary>
    public class HelloWorldWF : IWorkflow
    {
        /// <summary>
        /// 通过代码实现来装配工作流的环节
        /// </summary>
        /// <param name="builder"></param>
        public void Build(IWorkflowBuilder builder)
        {
            builder.HttpEndpoint("/helloworld")//监听端点路径
            .WriteHttpResponse(HttpStatusCode.OK, "<h1>hello World!</h1>", "text/html");//http响应输出
        }
    }
}
